home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 October: Mac OS SDK / Dev.CD Oct 00 SDK1.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / AppleScript.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  5.6 KB  |  209 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        AppleScript.h
  3.  
  4.      Contains:    AppleScript Specific Interfaces.
  5.  
  6.      Version:    Technology:    AppleScript 1.1
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1992-1999 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __APPLESCRIPT__
  18. #define __APPLESCRIPT__
  19.  
  20. #ifndef __MACERRORS__
  21.     #include <MacErrors.h>
  22. #endif
  23.  
  24. #ifndef __APPLEEVENTS__
  25.     #include <AppleEvents.h>
  26. #endif
  27.  
  28. #ifndef __OSA__
  29.     #include <OSA.h>
  30. #endif
  31.  
  32. #ifndef __TEXTEDIT__
  33.     #include <TextEdit.h>
  34. #endif
  35.  
  36.  
  37.  
  38.  
  39. #if PRAGMA_ONCE
  40. #pragma once
  41. #endif
  42.  
  43. #ifdef __cplusplus
  44. extern "C" {
  45. #endif
  46.  
  47. #if PRAGMA_IMPORT
  48. #pragma import on
  49. #endif
  50.  
  51. #if PRAGMA_STRUCT_ALIGN
  52.     #pragma options align=mac68k
  53. #elif PRAGMA_STRUCT_PACKPUSH
  54.     #pragma pack(push, 2)
  55. #elif PRAGMA_STRUCT_PACK
  56.     #pragma pack(2)
  57. #endif
  58.  
  59. /**************************************************************************
  60.     Types and Constants
  61. **************************************************************************/
  62. /*
  63.     The specific type for the AppleScript instance of the
  64.     Open Scripting Architecture type.
  65. */
  66. enum {
  67.     typeAppleScript                = FOUR_CHAR_CODE('ascr'),
  68.     kAppleScriptSubtype            = typeAppleScript,
  69.     typeASStorage                = typeAppleScript
  70. };
  71.  
  72. /**************************************************************************
  73.     Component Selectors
  74. **************************************************************************/
  75.  
  76. enum {
  77.     kASSelectInit                = 0x1001,
  78.     kASSelectSetSourceStyles    = 0x1002,
  79.     kASSelectGetSourceStyles    = 0x1003,
  80.     kASSelectGetSourceStyleNames = 0x1004
  81. };
  82.  
  83.  
  84. /**************************************************************************
  85.     OSAGetScriptInfo Selectors
  86. **************************************************************************/
  87. enum {
  88.     kASHasOpenHandler            = FOUR_CHAR_CODE('hsod')
  89. };
  90.  
  91. /*
  92.         This selector is used to query a context as to whether it contains
  93.         a handler for the kAEOpenDocuments event. This allows "applets" to be 
  94.         distinguished from "droplets."  OSAGetScriptInfo returns false if
  95.         there is no kAEOpenDocuments handler, and returns the error value 
  96.         errOSAInvalidAccess if the input is not a context.
  97.     */
  98. /**************************************************************************
  99.     Initialization
  100. **************************************************************************/
  101. EXTERN_API( OSAError )
  102. ASInit                            (ComponentInstance         scriptingComponent,
  103.                                  long                     modeFlags,
  104.                                  long                     minStackSize,
  105.                                  long                     preferredStackSize,
  106.                                  long                     maxStackSize,
  107.                                  long                     minHeapSize,
  108.                                  long                     preferredHeapSize,
  109.                                  long                     maxHeapSize)                        FIVEWORDINLINE(0x2F3C, 0x001C, 0x1001, 0x7000, 0xA82A);
  110.  
  111. /*
  112.         ComponentCallNow(kASSelectInit, 28);
  113.         This call can be used to explicitly initialize AppleScript.  If it is
  114.         not called, the a scripting size resource is looked for and used. If
  115.         there is no scripting size resource, then the constants listed below
  116.         are used.  If at any stage (the init call, the size resource, the 
  117.         defaults) any of these parameters are zero, then parameters from the
  118.         next stage are used.  ModeFlags are not currently used.
  119.         Errors:
  120.         errOSASystemError        initialization failed
  121.     */
  122. /*
  123.     These values will be used if ASInit is not called explicitly, or if any
  124.     of ASInit's parameters are zero:
  125. */
  126. enum {
  127.     kASDefaultMinStackSize        = 4 * 1024,
  128.     kASDefaultPreferredStackSize = 16 * 1024,
  129.     kASDefaultMaxStackSize        = 16 * 1024,
  130.     kASDefaultMinHeapSize        = 4 * 1024,
  131.     kASDefaultPreferredHeapSize    = 16 * 1024,
  132.     kASDefaultMaxHeapSize        = 32L * 1024 * 1024
  133. };
  134.  
  135. /**************************************************************************
  136.     Source Styles
  137. **************************************************************************/
  138. EXTERN_API( OSAError )
  139. ASSetSourceStyles                (ComponentInstance         scriptingComponent,
  140.                                  STHandle                 sourceStyles)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x1002, 0x7000, 0xA82A);
  141.  
  142. /*
  143.         ComponentCallNow(kASSelectSetSourceStyles, 4);
  144.         Errors:
  145.         errOSASystemError        operation failed
  146.     */
  147. EXTERN_API( OSAError )
  148. ASGetSourceStyles                (ComponentInstance         scriptingComponent,
  149.                                  STHandle *                resultingSourceStyles)                FIVEWORDINLINE(0x2F3C, 0x0004, 0x1003, 0x7000, 0xA82A);
  150.  
  151. /*
  152.         ComponentCallNow(kASSelectGetSourceStyles, 4);
  153.         Errors:
  154.         errOSASystemError        operation failed
  155.     */
  156. EXTERN_API( OSAError )
  157. ASGetSourceStyleNames            (ComponentInstance         scriptingComponent,
  158.                                  long                     modeFlags,
  159.                                  AEDescList *            resultingSourceStyleNamesList)        FIVEWORDINLINE(0x2F3C, 0x0008, 0x1004, 0x7000, 0xA82A);
  160.  
  161. /*
  162.         ComponentCallNow(kASSelectGetSourceStyleNames, 8);
  163.         This call returns an AEList of styled text descriptors the names of the
  164.         source styles in the current dialect.  The order of the names corresponds
  165.         to the order of the source style constants, below.  The style of each
  166.         name is the same as the styles returned by ASGetSourceStyles.
  167.         
  168.         Errors:
  169.         errOSASystemError        operation failed
  170.     */
  171. /*
  172.     Elements of STHandle correspond to following categories of tokens, and
  173.     accessed through following index constants:
  174. */
  175. enum {
  176.     kASSourceStyleUncompiledText = 0,
  177.     kASSourceStyleNormalText    = 1,
  178.     kASSourceStyleLanguageKeyword = 2,
  179.     kASSourceStyleApplicationKeyword = 3,
  180.     kASSourceStyleComment        = 4,
  181.     kASSourceStyleLiteral        = 5,
  182.     kASSourceStyleUserSymbol    = 6,
  183.     kASSourceStyleObjectSpecifier = 7,
  184.     kASNumberOfSourceStyles        = 8
  185. };
  186.  
  187.  
  188.  
  189. #if PRAGMA_STRUCT_ALIGN
  190.     #pragma options align=reset
  191. #elif PRAGMA_STRUCT_PACKPUSH
  192.     #pragma pack(pop)
  193. #elif PRAGMA_STRUCT_PACK
  194.     #pragma pack()
  195. #endif
  196.  
  197. #ifdef PRAGMA_IMPORT_OFF
  198. #pragma import off
  199. #elif PRAGMA_IMPORT
  200. #pragma import reset
  201. #endif
  202.  
  203. #ifdef __cplusplus
  204. }
  205. #endif
  206.  
  207. #endif /* __APPLESCRIPT__ */
  208.  
  209.